using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class ATL_oe_Delete_VWMap : EntityTypeConfiguration<ATL_oe_Delete_VW>
    {
        public ATL_oe_Delete_VWMap()
        {
            // Primary Key
            this.HasKey(t => new { t.Type, t.Action_type });

            // Properties
            this.Property(t => t.Number)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.Bill_)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.Patient_id)
                .IsFixedLength()
                .HasMaxLength(6);

            this.Property(t => t.Patient)
                .HasMaxLength(110);

            this.Property(t => t.Batch)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.Created_by)
                .HasMaxLength(15);

            this.Property(t => t.Deleted_on)
                .HasMaxLength(10);

            this.Property(t => t.Deleted_by)
                .HasMaxLength(15);

            this.Property(t => t.Type)
                .IsRequired()
                .HasMaxLength(11);

            this.Property(t => t.Action_type)
                .IsRequired()
                .HasMaxLength(9);

            // Table & Column Mappings
            this.ToTable("ATL_oe_Delete_VW");
            this.Property(t => t.Number).HasColumnName("Number");
            this.Property(t => t.Bill_).HasColumnName("Bill#");
            this.Property(t => t.Date).HasColumnName("Date");
            this.Property(t => t.Patient_id).HasColumnName("Patient_id");
            this.Property(t => t.Patient).HasColumnName("Patient");
            this.Property(t => t.Total).HasColumnName("Total");
            this.Property(t => t.Batch).HasColumnName("Batch");
            this.Property(t => t.Admission).HasColumnName("Admission");
            this.Property(t => t.Created_by).HasColumnName("Created_by");
            this.Property(t => t.Deleted_on).HasColumnName("Deleted_on");
            this.Property(t => t.Deleted_by).HasColumnName("Deleted_by");
            this.Property(t => t.Type).HasColumnName("Type");
            this.Property(t => t.Action_type).HasColumnName("Action_type");
        }
    }
}
